# -*- coding: utf-8 -*-

from django.db import models
from datetime import datetime

class Zhihu(models.Model):
	title = models.CharField(u'标题',max_length=150)
	links = models.CharField(u'链接',max_length=60)
	
	def __str__(self):
		return '%s %s' % (self.title, self.links)


class MultRecord(models.Model):
	multiplier = models.IntegerField(u"乘数")
	multiplicand = models.IntegerField(u"被乘数")
	mult_result = models.IntegerField(u"结果")
	mult_time = models.CharField(u"执行时间",max_length=30)
	mult_user = models.CharField(u"执行人",max_length=40)


	def to_json(self):
		return {
			"id": self.id,
			"multiplier":self.multiplier,
			"multiplicand":self.multiplicand,
			"mult_result":self.mult_result,
			"mult_time":self.mult_time,
			"mult_user":self.mult_user
		}